package com.shop.admin.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.shop.admin.valid.AddGroup;
import com.shop.admin.valid.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;
import java.io.Serializable;

/**
 * (ShopCategory)实体类
 *
 * @author makejava
 * @since 2022-09-02 21:39:01
 */
@Data
@TableName("shop_category")
public class ShopCategory implements Serializable {
    private static final long serialVersionUID = -67935851569362250L;
    /**
     * 分类id
     */
    @NotNull(message = "修改必须指定id",groups = {UpdateGroup.class})
    @Null(message = "新增不能指定id",groups = {AddGroup.class})
    @TableId
    private Long cateId;
    /**
     * 分类名字
     */
    @NotBlank(message = "分类名必须提交",groups = {AddGroup.class,UpdateGroup.class})
    private String cateName;
    /**
     * 分类url
     */
    @NotBlank(groups = {AddGroup.class})
    @URL(message = "图片必须是一个合法的url地址",groups={AddGroup.class, UpdateGroup.class})
    private String cateUrl;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更改时间
     */
    private Date updateTime;

    /**
     * 所属组织
     */
    private Integer orgId;

}

